X-Git-Url: https://permondes.de/gitweb/Analog_Engine.git/blobdiff_plain/4124db17783ef95a2a0020b4a7624b41c0f1b0e5..92b24062f5676c290b5d041358aaa25b49f2f4f2:/scripts/EP1%2010.03%20Coupled%20Pendulums.LACE?ds=inline diff --git a/scripts/EP1 10.03 Coupled Pendulums.LACE b/scripts/EP1 10.03 Coupled Pendulums.LACE new file mode 100644 index 0000000..5ef0517 --- /dev/null +++ b/scripts/EP1 10.03 Coupled Pendulums.LACE @@ -0,0 +1,34 @@ +# 2 coupled pendulums +# x1'' = -k1*x1 + k*(x2-x1) +# x2'' = -k2*x2 - k*(x2-x1) +# xi are the displacement of the pendulum to its resting position + +coefficient.1 -> k1 +coefficient.2 -> k2 +coefficient.3 -> k +coefficient.5(-1) -> -x10 # initial displacement x1 +coefficient.6(-1) -> -x20 # initial displacement x2 + +iintegrate x1'' -> -x1' +iintegrate -x1' -> x1 + IC: -x10 + +iintegrate x2'' -> -x2' +iintegrate -x2' -> x2 + IC: -x20 + +cmultiply x1, k1 -> k1*x1 +cmultiply x2, k2 -> k2*x2 + +invert x1 -> -x1 +isum x2, -x1 -> -(x2-x1) +cmultiply -(x2-x1), k -> -k*(x2-x1) + +isum k1*x1, -k*(x2-x1) -> -k1*x1+k*(x2-x1) +assign -k1*x1+k*(x2-x1) -> x1'' +invert -k*(x2-x1) -> k*(x2-x1) +isum k2*x2, k*(x2-x1) -> -k2*x2-k*(x2-x1) +assign -k2*x2-k*(x2-x1) -> x2'' + +output x1 -> out.x +output x2 -> out.y